package state;

public class Context {

    /**
     *
     */
    int flag = 0;

    private State state;

    public void request(){
        flag++;
        if(flag<2){
            state = new ConcreteStateA();

        }else{
            state = new ConcreteStateB();
        }
        state.doAction();
    }
}
